<?php


class Timer extends CI_Controller {

public function index(){
// 每隔5s触发一次
swoole_timer_tick(5000, function ($timer_id) {
    $where['order_status']=10;
    $list=$this->db->where($where)->get('order')->result_array();
    foreach ($list as $v) {
      if(time()>($v['create_time']+1800)){
      	$data['order_status']=50;
      	$this->db->where('order_id',$v['order_id'])->update('order',$data);
      }
    }
    echo 1;
});

	}

}
